home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- //
- // Alias|Wavefront Script File
- // MODIFY THIS AT YOUR OWN RISK
- //
- // Creation Date: 15 April 1997
- // Author: asg + clm
- //
- // Description:
- // Option box dialog for 'pathAnimation' command
- //
-
-
- //
- // Procedure Name:
- // setOptionVars
- //
- // Description:
- // Initialize the option values.
- //
- // Input Arguments:
- // Whether to set the options to default values.
- //
- // Return Value:
- // None.
- //
- proc setOptionVars(int $forceFactorySettings)
- {
- // FractionMode.
- //
- if ($forceFactorySettings || !`optionVar -exists pathAnimParametricLengthCB`) {
- optionVar -intValue pathAnimParametricLengthCB 0;
- }
-
- // Follow.
- //
- if ($forceFactorySettings || !`optionVar -exists pathAnimFollowCB`) {
- optionVar -intValue pathAnimFollowCB 1;
- }
-
- if ($forceFactorySettings || !`optionVar -exists pathAnimFrontAxisRB`) {
- optionVar -intValue pathAnimFrontAxisRB 1;
- optionVar -intValue pathAnimPrevFrontAxis 1;
- }
-
- if ($forceFactorySettings || !`optionVar -exists pathAnimUpAxisRB`) {
- optionVar -intValue pathAnimUpAxisRB 2;
- optionVar -intValue pathAnimPrevUpAxis 2;
- }
-
- // World up
-
- if ($forceFactorySettings || !`optionVar -exists pathAnimWorldUpTypeOM`) {
- optionVar -stringValue pathAnimWorldUpTypeOM "vector";
- }
-
- if ($forceFactorySettings || !`optionVar -exists pathAnimWorldUpVectorFF`) {
- optionVar -floatValue pathAnimWorldUpVectorFF 0.0
- -floatValueAppend pathAnimWorldUpVectorFF 1.0
- -floatValueAppend pathAnimWorldUpVectorFF 0.0;
- }
-
- if ($forceFactorySettings || !`optionVar -exists pathAnimWorldUpObjectTF`) {
- optionVar -stringValue pathAnimWorldUpObjectTF "";
- }
-
- if ($forceFactorySettings || !`optionVar -exists pathAnimInverseUpCB`) {
- optionVar -intValue pathAnimInverseUpCB 0;
- }
-
- if ($forceFactorySettings || !`optionVar -exists pathAnimInverseFrontCB`) {
- optionVar -intValue pathAnimInverseFrontCB 0;
- }
-
-
-
- // Bank.
- //
- if ($forceFactorySettings || !`optionVar -exists pathAnimBankCB`) {
- optionVar -intValue pathAnimBankCB 0;
- }
-
- if ($forceFactorySettings || !`optionVar -exists pathAnimBankScaleSG`) {
- optionVar -floatValue pathAnimBankScaleSG 1.0;
- }
-
- if ($forceFactorySettings || !`optionVar -exists pathAnimBankMaxSG`) {
- optionVar -floatValue pathAnimBankMaxSG 90.0;
- }
-
- // Time.
- //
- if ($forceFactorySettings || !`optionVar -exists pathAnimFrameRangeRB`) {
- optionVar -intValue pathAnimFrameRangeRB 1;
- }
-
- if ($forceFactorySettings || !`optionVar -exists pathAnimStartTimeSG`) {
- optionVar -floatValue pathAnimStartTimeSG 1.0;
- }
-
- if ($forceFactorySettings || !`optionVar -exists pathAnimEndTimeSG`) {
- optionVar -floatValue pathAnimEndTimeSG 30.0;
- }
- }
-
- //
- // Procedure Name:
- // pathAnimationSetup
- //
- // Description:
- // Update the state of the option box UI to reflect the option values.
- //
- // Input Arguments:
- // parent - Top level parent layout of the option box UI.
- // Required so that UI object names can be
- // successfully resolved.
- //
- // forceFactorySettings - Whether the option values should be set to
- // default values.
- //
- // Return Value:
- // None.
- //
- global proc pathAnimationSetup(string $parent, int $forceFactorySettings)
- {
- // Retrieve the option settings
- //
- setOptionVars($forceFactorySettings);
-
- setParent $parent;
-
- // Query the optionVar's and set the values into the controls.
-
- // fractionMode.
- //
- checkBoxGrp -edit -v1 `optionVar -query pathAnimParametricLengthCB`
- pathAnimParametricLengthCB;
-
- // Follow.
- //
- checkBoxGrp -edit -v1 `optionVar -query pathAnimFollowCB`
- pathAnimFollowCB;
-
- radioButtonGrp -edit -select `optionVar -query pathAnimFrontAxisRB`
- pathAnimFrontAxisRB;
-
- radioButtonGrp -edit -select `optionVar -query pathAnimUpAxisRB`
- pathAnimUpAxisRB;
-
- // World up
-
- string $worldUpType = `optionVar -query pathAnimWorldUpTypeOM`;
- switch ( $worldUpType )
- {
- case "scene":
- optionMenuGrp -edit -select 1 pathAnimWorldUpTypeOM;
- break;
- case "object":
- optionMenuGrp -edit -select 2 pathAnimWorldUpTypeOM;
- break;
- case "objectrotation":
- optionMenuGrp -edit -select 3 pathAnimWorldUpTypeOM;
- break;
- case "vector":
- optionMenuGrp -edit -select 4 pathAnimWorldUpTypeOM;
- break;
- case "normal":
- optionMenuGrp -edit -select 5 pathAnimWorldUpTypeOM;
- break;
- }
-
- float $worldUpVector[] = `optionVar -query pathAnimWorldUpVectorFF`;
- floatFieldGrp -edit
- -value1 $worldUpVector[0]
- -value2 $worldUpVector[1]
- -value3 $worldUpVector[2]
- pathAnimWorldUpVectorFF;
-
- textFieldGrp -edit
- -text `optionVar -query pathAnimWorldUpObjectTF`
- pathAnimWorldUpObjectTF;
-
- checkBoxGrp -edit -v1 `optionVar -query pathAnimInverseUpCB`
- pathAnimInverseUpCB;
-
- checkBoxGrp -edit -v1 `optionVar -query pathAnimInverseFrontCB`
- pathAnimInverseFrontCB;
-
-
-
- // Bank.
- //
- checkBoxGrp -edit -v1 `optionVar -query pathAnimBankCB`
- pathAnimBankCB;
-
- floatSliderGrp -edit -value `optionVar -query pathAnimBankScaleSG`
- pathAnimBankScaleSG;
-
- floatSliderGrp -edit -value `optionVar -query pathAnimBankMaxSG`
- pathAnimBankMaxSG;
-
- // Time.
- //
- radioButtonGrp -edit -select `optionVar -query pathAnimFrameRangeRB`
- pathAnimFrameRangeRB;
-
- floatFieldGrp -edit -value1 `optionVar -query pathAnimStartTimeSG`
- pathAnimStartTimeSG;
-
- floatFieldGrp -edit -value1 `optionVar -query pathAnimEndTimeSG`
- pathAnimEndTimeSG;
-
- // When reseting to the factory settings, make sure the visibility
- // or collapse/expand states of the tabs are updated accordingly
- //
- pathAnimEnabling $parent 1;
- pathAnimEnabling $parent 2;
- pathAnimEnabling $parent 3;
- pathAnimEnabling $parent 4;
- pathAnimEnabling $parent 5;
- pathAnimEnabling $parent 6;
- }
-
- //
- // Procedure Name:
- // pathAnimationCallback
- //
- // Description:
- // Update the option values with the current state of the option box UI.
- //
- // Input Arguments:
- // parent - Top level parent layout of the option box UI. Required so
- // that UI object names can be successfully resolved.
- //
- // doIt - Whether the command should execute.
- //
- // Return Value:
- // None.
- //
- global proc pathAnimationCallback(string $parent, int $doIt)
- {
- setParent $parent;
-
- // Set the optionVar's from the control values, and then
- // perform the command.
-
- // ParametricLength.
- //
- optionVar -intValue pathAnimParametricLengthCB
- `checkBoxGrp -query -v1 pathAnimParametricLengthCB`;
-
- // Follow.
- //
- optionVar -intValue pathAnimFollowCB
- `checkBoxGrp -query -v1 pathAnimFollowCB`;
-
- optionVar -intValue pathAnimFrontAxisRB
- `radioButtonGrp -query -select pathAnimFrontAxisRB`;
-
- optionVar -intValue pathAnimUpAxisRB
- `radioButtonGrp -query -select pathAnimUpAxisRB`;
-
- // World up
-
- int $state = `optionMenuGrp -query -select pathAnimWorldUpTypeOM`;
- switch ( $state )
- {
- case 1:
- optionVar -stringValue pathAnimWorldUpTypeOM "scene";
- break;
- case 2:
- optionVar -stringValue pathAnimWorldUpTypeOM "object";
- break;
- case 3:
- optionVar -stringValue pathAnimWorldUpTypeOM "objectrotation";
- break;
- case 4:
- optionVar -stringValue pathAnimWorldUpTypeOM "vector";
- break;
- case 5:
- optionVar -stringValue pathAnimWorldUpTypeOM "normal";
- break;
- }
-
- optionVar -floatValue pathAnimWorldUpVectorFF
- `floatFieldGrp -query -value1 pathAnimWorldUpVectorFF`
- -floatValueAppend pathAnimWorldUpVectorFF
- `floatFieldGrp -query -value2 pathAnimWorldUpVectorFF`
- -floatValueAppend pathAnimWorldUpVectorFF
- `floatFieldGrp -query -value3 pathAnimWorldUpVectorFF`;
-
- optionVar -stringValue pathAnimWorldUpObjectTF
- `textFieldGrp -query -text pathAnimWorldUpObjectTF`;
-
- optionVar -intValue pathAnimInverseUpCB
- `checkBoxGrp -query -v1 pathAnimInverseUpCB`;
-
- optionVar -intValue pathAnimInverseFrontCB
- `checkBoxGrp -query -v1 pathAnimInverseFrontCB`;
-
- // Bank.
- //
- optionVar -intValue pathAnimBankCB
- `checkBoxGrp -query -v1 pathAnimBankCB`;
-
- optionVar -floatValue pathAnimBankScaleSG
- `floatSliderGrp -query -v pathAnimBankScaleSG`;
-
- optionVar -floatValue pathAnimBankMaxSG
- `floatSliderGrp -query -v pathAnimBankMaxSG`;
-
- // Time.
- //
- optionVar -intValue pathAnimFrameRangeRB
- `radioButtonGrp -query -select pathAnimFrameRangeRB`;
-
- optionVar -floatValue pathAnimStartTimeSG
- `floatFieldGrp -query -v1 pathAnimStartTimeSG`;
-
- optionVar -floatValue pathAnimEndTimeSG
- `floatFieldGrp -query -v1 pathAnimEndTimeSG`;
-
- if ($doIt) {
- performPathAnimation false;
- addToRecentCommandQueue "performPathAnimation false" "PathAnimation";
- }
- }
-
-
- // Callbacks to dim/undim different widgets depending on the states
- // of other widgets
- //
- // Value of $widget = 1 .... Update the display of Start/End
- // = 2 .... Update the display of Follow options
- // = 3 .... Update the display of Bank options
- // = 4 .... Make sure Up != Front
- // = 5 .... Make sure Front != Up
- // = 6 .... Update the display of the world up widgets
- //
- global proc pathAnimEnabling(string $parent, int $widget)
- {
- setParent $parent;
-
- switch($widget)
- {
- case 1: // Update the Start/End display
- int $state = `radioButtonGrp -query -select pathAnimFrameRangeRB`;
- switch ($state)
- {
- case 1: // "Time Slider"
- frameLayout -edit -enable false startFrame;
- frameLayout -edit -enable false endFrame;
- break;
- case 2: // "Start"
- frameLayout -edit -enable true startFrame;
- frameLayout -edit -enable false endFrame;
- break;
- case 3: // "Start/End"
- frameLayout -edit -enable true startFrame;
- frameLayout -edit -enable true endFrame;
- break;
- }
- break;
-
- case 2: // Update Follow options display
- int $state = `checkBoxGrp -query -value1 pathAnimFollowCB`;
- frameLayout -edit -enable $state pathAnimationFollowFrame;
- break;
-
- case 3: // Update Bank options display
- int $followState = `checkBoxGrp -query -value1 pathAnimFollowCB`;
- int $bankState = `checkBoxGrp -query -value1 pathAnimBankCB`;
- if ($followState && $bankState)
- frameLayout -edit -enable true pathAnimBankFrame;
- else
- frameLayout -edit -enable false pathAnimBankFrame;
- break;
-
- case 4: // Make sure the Up is not the same value as the Front
- int $front = `radioButtonGrp -query -select pathAnimFrontAxisRB`;
- int $up = `radioButtonGrp -query -select pathAnimUpAxisRB`;
-
- if ($front == $up)
- {
- int $prevFront = `optionVar -query pathAnimPrevFrontAxis`;
- radioButtonGrp -edit -select $prevFront pathAnimUpAxisRB;
- optionVar -intValue pathAnimPrevUpAxis $prevFront;
- }
-
- // Remember the current state of the Front
- //
- optionVar -intValue pathAnimPrevFrontAxis $front;
- break;
-
- case 5: // Make sure the Front is not the same value as the Up
- int $front = `radioButtonGrp -query -select pathAnimFrontAxisRB`;
- int $up = `radioButtonGrp -query -select pathAnimUpAxisRB`;
-
- if ($front == $up)
- {
- int $prevUp = `optionVar -query pathAnimPrevUpAxis`;
- radioButtonGrp -edit -select $prevUp pathAnimFrontAxisRB;
- optionVar -intValue pathAnimPrevFrontAxis $prevUp;
- }
-
- // Remember the current state of the Up
- //
- optionVar -intValue pathAnimPrevUpAxis $up;
- break;
-
- case 6:
- int $followState = `checkBoxGrp -query -value1 pathAnimFollowCB`;
- if ( $followState )
- {
- int $state = `optionMenuGrp -query -select pathAnimWorldUpTypeOM`;
- switch ( $state )
- {
- case 1: // Scene Up
- case 5: // Normal
- floatFieldGrp -edit -enable false pathAnimWorldUpVectorFF;
- textFieldGrp -edit -enable false pathAnimWorldUpObjectTF;
- break;
- case 2: // Object Up
- floatFieldGrp -edit -enable false pathAnimWorldUpVectorFF;
- textFieldGrp -edit -enable true pathAnimWorldUpObjectTF;
- break;
- case 3: // Object Rotation Up
- floatFieldGrp -edit -enable true pathAnimWorldUpVectorFF;
- textFieldGrp -edit -enable true pathAnimWorldUpObjectTF;
- break;
- case 4: // Vector
- floatFieldGrp -edit -enable true pathAnimWorldUpVectorFF;
- textFieldGrp -edit -enable false pathAnimWorldUpObjectTF;
- break;
- }
- }
- else
- {
- floatFieldGrp -edit -enable false pathAnimWorldUpVectorFF;
- textFieldGrp -edit -enable false pathAnimWorldUpObjectTF;
- }
- break;
- }
- }
-
-
- // Create the UI widgets in the option box
- //
- proc string pathAnimationWidgets(string $parent)
- {
- setParent $parent;
-
- string $tabForm = `columnLayout -adjustableColumn true`;
-
- radioButtonGrp -numberOfRadioButtons 3
- -label "Time Range"
- -select 1
- -cc ("pathAnimEnabling " + $parent + " 1")
- -label1 "Time Slider" -columnWidth 2 100
- -label2 "Start"
- -label3 "Start/End"
- pathAnimFrameRangeRB;
-
- frameLayout -bv no -lv no -collapsable yes -collapse no -enable true startFrame;
- columnLayout -adjustableColumn true;
- floatFieldGrp -l "Start Time" pathAnimStartTimeSG;
- setParent ..;
- setParent ..;
-
- frameLayout -bv no -lv no -collapsable yes -collapse no -enable false endFrame;
- columnLayout -adjustableColumn true;
- floatFieldGrp -l "End Time" pathAnimEndTimeSG;
- setParent ..;
- setParent ..;
-
- separator -style "in";
-
- checkBoxGrp -l "Parametric Length" -ncb 1 -l1 " " -v1 false
- pathAnimParametricLengthCB;
-
- checkBoxGrp -l "Follow" -ncb 1 -l1 " " -v1 false
- -cc ("pathAnimEnabling " + $parent + " 2; pathAnimEnabling " + $parent + " 3; pathAnimEnabling " + $parent + " 6")
- pathAnimFollowCB;
-
- frameLayout -bv no -lv no
- -collapsable true
- -collapse no
- -enable false
- pathAnimationFollowFrame;
-
- columnLayout -adjustableColumn true;
- radioButtonGrp -nrb 3
- -l "Front Axis"
- -onc ("pathAnimEnabling " + $parent + " 4")
- -l1 "X" -l2 "Y" -l3 "Z"
- pathAnimFrontAxisRB;
-
- radioButtonGrp -nrb 3
- -l "Up Axis"
- -onc ("pathAnimEnabling " + $parent + " 5")
- -l1 "X" -l2 "Y" -l3 "Z"
- pathAnimUpAxisRB;
-
- optionMenuGrp -l "World Up Type"
- -cc ("pathAnimEnabling " + $parent + " 6")
- pathAnimWorldUpTypeOM;
- menuItem -l "Scene Up" pathAnimUpDirMI1;
- menuItem -l "Object Up" pathAnimUpDirMI2;
- menuItem -l "Object Rotation Up" pathAnimUpDirMI3;
- menuItem -l "Vector" pathAnimUpDirMI4;
- menuItem -l "Normal" pathAnimUpDirMI5;
-
- floatFieldGrp -l "World Up Vector" -nf 3 pathAnimWorldUpVectorFF;
-
- textFieldGrp -l "World Up Object" pathAnimWorldUpObjectTF;
-
- checkBoxGrp -ncb 1 -l ""
- -l1 "Inverse Up" -v1 false
- pathAnimInverseUpCB;
-
- checkBoxGrp -ncb 1 -l ""
- -l1 "Inverse Front" -v1 false
- pathAnimInverseFrontCB;
-
- checkBoxGrp -ncb 1 -l ""
- -l1 "Bank"
- -v1 false
- -cc ("pathAnimEnabling " + $parent + " 3")
- pathAnimBankCB;
-
- frameLayout -bv no -lv no
- -collapsable true
- -enable false
- -collapse false
- pathAnimBankFrame;
-
- columnLayout -adjustableColumn true;
- floatSliderGrp -l "Bank Scale"
- -field true
- -min -10.0 -max 10.0
- -v 1.0
- -s 0.1
- pathAnimBankScaleSG;
- floatSliderGrp -l "Bank Limit"
- -field true
- -min -179 -max 179
- -v 90
- -s 1
- pathAnimBankMaxSG;
- setParent ..;
- setParent ..; // pathAnimBankFrame
-
- setParent ..; //
- setParent ..; // pathAnimationFollowFrame
-
- return $tabForm;
- }
-
-
- //
- // Procedure Name:
- // pathAnimationOptions
- //
- // Description:
- // Construct the option box UI. Involves accessing the standard option
- // box and customizing the UI accordingly.
- //
- // Input Arguments:
- // None.
- //
- // Return Value:
- // None.
- //
- proc pathAnimationOptions()
- {
- // Name of the command for this option box.
- //
- string $commandName = "pathAnimation";
-
- // Build the option box actions.
- //
- string $callback = ($commandName + "Callback");
- string $setup = ($commandName + "Setup");
-
- // STEP 1: Get the option box.
- // ============================
- //
- // The value returned is the name of the layout to be used as
- // the parent for the option box UI.
- //
- string $layout = getOptionBox();
- setParent $layout;
-
- // STEP 2: Activate the default UI template.
- // ==========================================
- //
- // Activate the default UI template so that the layout of this
- // option box is consistent with the layout of the rest of the
- // application.
- //
- setUITemplate -pushTemplate DefaultTemplate;
-
- // STEP 3: Create option box contents.
- // ===================================
- //
- // This, of course, will vary from option box to option box.
-
- // Turn on the wait cursor.
- //
- waitCursor -state 1;
-
- // RECOMMENDATION: Place the UI in a scroll layout. If the
- // option box window is ever resized such that it's entire
- // contents is not visible then the scroll bars provided by the
- // scroll layout will allow the user to access the hidden UI.
- //
- tabLayout -scr true -tv false;
-
- string $parent = `columnLayout -adjustableColumn 1`;
-
-
- // Build the option box contents
- //
- pathAnimationWidgets $parent;
-
-
- // Turn off the wait cursor.
- //
- waitCursor -state 0;
-
- // Step 4: Deactivate the default UI template.
- // ===========================================
- //
- setUITemplate -popTemplate;
-
- // Step 5: Customize the buttons.
- // ==============================
- //
- // Provide more descriptive labels for the buttons. This is not
- // necessary, but in some cases, for example, a button labelled
- // 'Create' may be more meaningful to the user than one labelled
- // 'Apply'.
- //
- // Disable those buttons that are not applicable to the option box.
- //
- // Attach actions to those buttons that are applicable to the option
- // box. Note that the 'Close' button has a default action attached
- // to it that will hide the window. If a custom action is
- // attached to the 'Close' button then be sure to call the 'hide the
- // option box' procedure within the custom action so that the option
- // box is hidden properly.
-
- // 'Apply' button.
- //
- string $applyBtn = getOptionBoxApplyBtn();
- button -edit
- -command ($callback + " " + $parent + " " + 1)
- -label "Attach"
- $applyBtn;
- dimWhen -false "SomethingSelected" $applyBtn;
-
- // 'Save' button.
- //
- string $saveBtn = getOptionBoxSaveBtn();
- button -edit
- -command ($callback + " " + $parent + " " + 0 + "; hideOptionBox")
- $saveBtn;
-
- // 'Reset' button.
- //
- string $resetBtn = getOptionBoxResetBtn();
- button -edit
- -command ($setup + " " + $parent + " " + 1)
- $resetBtn;
-
- // Step 6: Set the option box title.
- // =================================
- //
- setOptionBoxTitle("Attach to Motion Path Options");
-
- // Step 7: Customize the 'Help' menu item text.
- // ============================================
- //
- setOptionBoxHelpTag( "AttachtoMotionPath" );
-
- // Step 8: Set the current values of the option box.
- // =================================================
- //
- eval (($setup + " " + $parent + " " + 0));
-
- // Step 9: Show the option box.
- // =================================
- //
- showOptionBox();
- }
-
-
- //
- // Procedure Name:
- // assembleCmd
- //
- // Description:
- // Construct the command that will apply the option box values.
- //
- // Input Arguments:
- // None.
- //
- // Return Value:
- // None.
- //
- proc string assembleCmd()
- {
- string $cmd = "pathAnimation";
-
- setOptionVars(false);
-
- int $index = `optionVar -query pathAnimFrontAxisRB`;
- string $followAxis = "y";
- if( $index == 1 ) $followAxis = "x";
- else if( $index == 3 ) $followAxis = "z";
-
- $index = `optionVar -query pathAnimUpAxisRB`;
- string $upAxis = "z";
- if( $index == 1 ) $upAxis = "x";
- else if( $index == 2 ) $upAxis = "y";
-
- // fractionMode option
- //
- if( `optionVar -query pathAnimParametricLengthCB` ) {
- $cmd = ($cmd + " -fractionMode false" );
- }
- else {
- $cmd = ($cmd + " -fractionMode true" );
- }
-
- // follow related options
- //
- if( `optionVar -query pathAnimFollowCB` ) {
- $cmd = ($cmd
- + " -follow true"
- + " -followAxis " + $followAxis
- + " -upAxis " + $upAxis
- );
-
- // world up related options
-
- string $worldUpType = `optionVar -query pathAnimWorldUpTypeOM`;
- $cmd = ($cmd + " -worldUpType " + "\"" + $worldUpType + "\"" );
- switch ( $worldUpType )
- {
- case "scene":
- case "normal":
- break;
- case "object":
- string $worldUpObject = `optionVar -query pathAnimWorldUpObjectTF`;
- $cmd = ($cmd + " -worldUpObject " + $worldUpObject);
- break;
- case "objectrotation":
- float $worldUpVector[] = `optionVar -query pathAnimWorldUpVectorFF`;
- $cmd = ($cmd + " -worldUpVector "
- + $worldUpVector[0] + " "
- + $worldUpVector[1] + " "
- + $worldUpVector[2]);
- string $worldUpObject = `optionVar -query pathAnimWorldUpObjectTF`;
- $cmd = ($cmd + " -worldUpObject " + $worldUpObject);
- break;
- case "vector":
- float $worldUpVector[] = `optionVar -query pathAnimWorldUpVectorFF`;
- $cmd = ($cmd + " -worldUpVector "
- + $worldUpVector[0] + " "
- + $worldUpVector[1] + " "
- + $worldUpVector[2]);
- break;
- }
-
- if( `optionVar -query pathAnimInverseUpCB` ) {
- $cmd = ($cmd + " -inverseUp true" );
- }
- else {
- $cmd = ($cmd + " -inverseUp false" );
- }
-
- if( `optionVar -query pathAnimInverseFrontCB` ) {
- $cmd = ($cmd + " -inverseFront true" );
- }
- else {
- $cmd = ($cmd + " -inverseFront false" );
- }
-
-
-
- // bank related options
- //
- if( `optionVar -query pathAnimBankCB` ) {
- $cmd = ($cmd
- + " -bank true"
- + " -bankScale " + `optionVar -query pathAnimBankScaleSG`
- + " -bankThreshold " + `optionVar -query pathAnimBankMaxSG`
- );
- }
- else {
- $cmd = ($cmd + " -bank false" );
- }
- }
- else {
- $cmd = ($cmd + " -follow false" );
- }
-
- // timing options
- //
- int $timing = `optionVar -query pathAnimFrameRangeRB`;
- if ($timing == 1) // "Time Slider"
- {
- // Note that we're embedding the time slider query into the string,
- // because if dragged to the shelf with the "Time Slider" option,
- // we want to re-evaluate what the current time slider range is
- // each time it is invoked from the shelf.
- //
- $cmd = ($cmd + " -startTimeU `playbackOptions -query -minTime` "
- + "-endTimeU `playbackOptions -query -maxTime`");
- }
- else // "Start" or "Start/End"
- {
- $cmd = ($cmd+ " -startTimeU " + `optionVar -query pathAnimStartTimeSG`);
-
- if ($timing == 3) // Start/End
- $cmd = ($cmd+ " -endTimeU " + `optionVar -query pathAnimEndTimeSG`);
- }
-
- return $cmd;
- }
-
- //
- // Procedure Name:
- // performPathAnimation
- //
- // Description:
- // Perform the pathAnimation command using the corresponding
- // option values. This procedure will also show the option box
- // window if necessary as well as construct the command string
- // that will invoke the pathAnimation command with the current
- // option box values.
- //
- // Input Arguments:
- // 0 - Execute the command.
- // 1 - Show the option box dialog.
- // 2 - Return the command.
- //
- // Return Value:
- // None.
- //
- global proc string performPathAnimation(int $action)
- {
- string $cmd = "";
-
- switch ($action) {
-
- // Execute the command.
- //
- case 0:
- // Retrieve the option settings
- //
- setOptionVars(false);
-
- // Get the command.
- //
- $cmd = `assembleCmd`;
-
- // Execute the command with the option settings.
- //
- evalEcho($cmd);
-
- break;
-
- // Show the option box.
- //
- case 1:
- pathAnimationOptions;
- break;
-
- // Return the command string.
- //
- case 2:
- // Retrieve the option settings.
- //
- setOptionVars (false);
-
- // Get the command.
- //
- $cmd = `assembleCmd`;
- break;
- }
- return $cmd;
- }
-
-